package com.xunk.common.core.enums.dnake;


/**
 * @Author: wangTong
 * @Description: 狄耐克MsgType枚举
 * @Date: 2021/5/12 10:50
 * @Version: 1.0
 */
public enum DnakeMsgTypeEnum {
    STATUS(0, "state", "设备状态"),
    LEVEL(1, "level", "设备的“LEVEL”值"),
    COLORLIGHTX(2,"colorx", "调色灯的色坐标 X"),
    COLORLIGHTY(3, "colory","调色灯的色坐标 Y"),
    SATURATION(4,"sat", "调色灯的饱和度"),
//    TONE(5, "调色灯的色调"),
    COLORTEMPERATURE(6,"colorTemp", "调色灯的色温"),
    BATTERY(7,"lowBat", "电池电量"),
//    OCCUPANCY(8, "OCCUPANCY 人体发现传感"),
//    THERMOSTAT1(9, "温控器温度上报"),
//    THERMOSTAT(10, "温控器模式"),
//    FAN(11, "风机模式"),
//    POWER(12, "智能插座功率：单位（W）"),
//    CONSUME(13, "智能插座耗电量：(KW/H)"),
    HUMIDITY(14, "humi", "湿度"),
    TEMPERATURE(15,"temp", "温度(摄氏度)"),
    PM10(16,"pm10", "PM10（(UG/M3)）"),
    PM25(17, "pm2.5","PM2.5(UG/M3)"),
    CO2(18, "co2","CO2(PPM)"),
    NOISE(19,"dbLevle", "噪声等级"),
    TVOC(20, "tvocLevel", "TVOC值"),
    ILLUMINANCE(21, "illumance","照度值"),
    AIRQUALITY(22,"aircdLevel","空气质量等级");
//    SCENE(23,"场景号");

    private Integer msgType;
    private String key;
    private String desc;

    DnakeMsgTypeEnum(Integer msgType, String key, String desc) {
        this.msgType = msgType;
        this.key = key;
        this.desc = desc;
    }
    public String getKey() {
        return key;
    }

    public Integer getMsgType() {
        return msgType;
    }

    public String getDesc() {
        return desc;
    }

    public static String getKeyByMsgType(Integer msgType){
        for(DnakeMsgTypeEnum dnakeActionEnum : DnakeMsgTypeEnum.values()){
            if(dnakeActionEnum.getMsgType() == msgType.intValue()){
                return dnakeActionEnum.getKey();
            }
        }
        return null;
    }

    public static String getDescByMsgType(Integer msgType){
        for(DnakeMsgTypeEnum dnakeActionEnum : DnakeMsgTypeEnum.values()){
            if(dnakeActionEnum.getMsgType() == msgType.intValue()){
                return dnakeActionEnum.getDesc();
            }
        }
        return null;
    }

}
